package com.firewolf.spring.service.origin;

import com.firewolf.spring.service.ICalucator;

/**
 * 传统的方式实现计算器并且记日志功能
 	在每一个方法里面记录日志
 * @author lx
 *
 */
public class Calculator1 implements ICalucator {

	@Override
	public double add(double i, double j) {
		System.out.println("日志，method add start with [" + i + "," + j + "]");
		double result = i + j;
		System.out.println(result);
		System.out.println("日志，method add end with " + result);
		return result;
	}

	@Override
	public double sub(double i, double j) {
		System.out.println("日志，method sub start with [" + i + "," + j + "]");
		double result = i - j;
		System.out.println(result);
		System.out.println("日志，method sub end with " + result);
		return result;
	}

	@Override
	public double multi(double i, double j) {
		System.out.println("日志，method multi start with [" + i + "," + j + "]");
		double result = i * j;
		System.out.println(result);
		System.out.println("日志，method multi end with " + result);
		return result;
	}

	@Override
	public double dev(double i, double j) {
		System.out.println("日志，method dev start with [" + i + "," + j + "]");
		double result = i / j;
		System.out.println(result);
		System.out.println("日志，method dev end with " + result);
		return result;
	}

}
